import cookie from 'cookie'
import jwt from 'jsonwebtoken'
export default async function handler(req, res) {
    const token = jwt.sign({
        aa:67869,
    },process.env.JWT_SECRET, { expiresIn: '3 days' });
    res.status(200);
    res.setHeader('Set-Cookie',cookie.serialize('token',token,{
        httpOnly: true,
        path: '/',
        maxAge: 60 * 60 * 24 * 3
    }))
    res.json({
        code:1,
        data:{
            
        },
        msg: "退出登录"
    })
}